<?php

/**
 * Created by 99468
 * Date: 2017/8/19
 * Time: 20:33
 * Author: weblinuxgame
 * email : 994685563@qq.com
 * license : MTI
 **/

namespace EpgApp\core\apps;

use EpgApp\core\classes\base\BaseObject;
use EpgApp\core\traits\apptraits\appCallTrait;
use EpgApp\core\traits\apptraits\toolsTrait;


class Apps extends BaseObject
{
    use appCallTrait,toolsTrait;

    public static $app ;
    private static $name ;

    public function __construct()
    {
        //@init __call
        $this->init();
    }

    public  static function getInstance($appname='')
    {
        if(empty($appname))
        {
            $appname = 'application' ;
        }
            self::$name = $appname ;
        if(empty(self::$app))
        {
            self::$app = new self();
        }
        return self::$app ;
    }

    public  function router()
    {
        return $this;
    }

    public  function api()
    {

        return $this;
    }

    public  function config($config='')
    {
        return $this;
    }

    public static function url()
    {

    }

    public static function emit()
    {

    }

    public  function run()
    {
        var_dump($this);
    }

}